diff options
| author | Adam <[email protected]> | 2026-02-27 15:50:50 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-27 15:50:50 -0600 |
| commit | 7f851da15ecde7db6535aae1f13009d3d6068daf (patch) | |
| tree | e8978e858c09a6507dfe0ad40b32b008d634b82e /packages/console/app/src/routes/auth/[...callback].ts | |
| parent | a3bdb974b36714ace5e2a41e76da8aa6682eb4c8 (diff) | |
| download | opencode-7f851da15ecde7db6535aae1f13009d3d6068daf.tar.gz opencode-7f851da15ecde7db6535aae1f13009d3d6068daf.zip | |
chore(console): i18n sync (#15360)
Diffstat (limited to 'packages/console/app/src/routes/auth/[...callback].ts')
| -rw-r--r-- | packages/console/app/src/routes/auth/[...callback].ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/console/app/src/routes/auth/[...callback].ts b/packages/console/app/src/routes/auth/[...callback].ts index 664f6cc6d..00bb89406 100644 --- a/packages/console/app/src/routes/auth/[...callback].ts +++ b/packages/console/app/src/routes/auth/[...callback].ts @@ -2,15 +2,17 @@ import { redirect } from "@solidjs/router" import type { APIEvent } from "@solidjs/start/server" import { AuthClient } from "~/context/auth" import { useAuthSession } from "~/context/auth" +import { i18n } from "~/i18n" import { localeFromRequest, route } from "~/lib/language" export async function GET(input: APIEvent) { const url = new URL(input.request.url) const locale = localeFromRequest(input.request) + const dict = i18n(locale) try { const code = url.searchParams.get("code") - if (!code) throw new Error("No code found") + if (!code) throw new Error(dict["auth.callback.error.codeMissing"]) const result = await AuthClient.exchange(code, `${url.origin}${url.pathname}`) if (result.err) throw new Error(result.err.message) const decoded = AuthClient.decode(result.tokens.access, {} as any) |
